package com.blb.servlet.admin;


import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 通用的后台JSP跳转Servlet
 */
@WebServlet("/admin/view/*")        //      /admin/view/login
public class AdminViewServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String uri = req.getRequestURI();   //  /admin/view/login       /admin/view/user/add
        uri = uri.replace("/admin/view/", "");      //  login   user/add
        req.getRequestDispatcher("/WEB-INF/jsp/admin/"+uri+".jsp").forward(req, resp);
    }
}
